class Person{
    name:string;
    age:number;
    constructor(name:string,age:number){
        this.name = name;
        this.age = age
    }
    getName():void{
        console.log(this.name);   
    }
}
class Student extends Person{
    skill:string;
    constructor(name:string,age:number,skill:string){
        super(name,age)
        this.skill = skill;
    }
    getSkill():void{
        console.log(this.skill);
        
    }
}
var s:Student = new Student("dai",18,"web前端");
var p:Person = new Person('lisi',19);
s.getName();//dai
// p.getSkill();  //报错  父类不能调用子类的方法